package com.ht.aems.fesmodel;

import java.util.Date;
import java.util.List;


/**
 * interface FesPersistence
 *
 * @author Dong Shufeng
 *         Date: 2006-12-14
 */
public interface FesPersistence {
    public static final String TABLE_UNIT = "UNITINFO";
    public static final String TABLE_COMMINFO = "COMMINFO";
    public static final String TABLE_ALG = "TALG";
    public static final String TABLE_DIS = "DISCRETE";
    public static final String TABLE_SOE = "YX_SOE";
    public static final String TABLE_ALG_YEAR = "TALG_YEAR";
    public static final String TABLE_DIS_YEAR = "DISCRETE_YEAR";
    public static final String TABLE_DIS_STATUS = "DISCRETE_STATUS_TIME";

    /**
     * save unit
     *
     * @param unit unit to save
     */
    public boolean saveUnit(AbstractUnit unit);

    /**
     * remove the unit
     *
     * @param unit unit to save
     */
    public boolean removeUnit(AbstractUnit unit);

    /**
     * getUnit
     * @param id the id of this unit
     * @return the units who's id is given in parameter 
     */
    public AbstractUnit getUnit(int id);

    public CommUnit getCommUnit(int id);

    public List<CommUnit> getCommUnitByName(String name);

    /**
     * @param parentid id of parent unit
     * @return return list of abstract unit whose parent unit id's is parentId
     */
    public List<AbstractUnit> getUnits(int parentid);

    public List<CommUnit> getCommUnitByType(int NRTUTYPE);
    /**
     * @return root unit whose parent id's -1
     */
    public List<IUnitManager> getRoots();

    public List<OriginalByteData> getOrinalDataList(int commId, String tableName);
}
